<html>
<head><meta charset="utf-8"><title>intra-doc `pointer` primitive · rustdoc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/index.html">rustdoc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html">intra-doc `pointer` primitive</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222248720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222248720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222248720">(Jan 10 2021 at 23:53)</a>:</h4>
<p>A couple weeks ago <span class="user-mention" data-user-id="232545">@Joshua Nelson</span> added intra-doc link targets (not sure what to call them <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span>) for "non-path primitives" like <code>slice</code> and <code>pointer</code>. The <code>pointer</code> primitive has the intra-doc aliases <code>*const</code>, <code>*mut</code>, and <code>*</code> (though it might be removed: <a href="https://github.com/rust-lang/rust/issues/80892">#80892</a>) as well. However, the <code>pointer</code> primitive feels like a bit of a footgun because things like <code>pointer::is_null</code> actually resolve to <code>&lt;*const T&gt;::is_null</code>. What should we do about it?</p>



<a name="222248775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222248775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222248775">(Jan 10 2021 at 23:54)</a>:</h4>
<p>(We have a bit of time to figure this out because it hasn't hit beta yet btw.)</p>



<a name="222249951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222249951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222249951">(Jan 11 2021 at 00:24)</a>:</h4>
<blockquote>
<p>However, the pointer primitive feels like a bit of a footgun because things like pointer::is_null actually resolve to &lt;*const T&gt;::is_null. </p>
</blockquote>
<p>err, well, they happen to resolve that way for implementation reasons, but they could just as easily have been <code>*mut</code></p>



<a name="222249962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222249962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222249962">(Jan 11 2021 at 00:24)</a>:</h4>
<p>I think the practical thing to do is slap this behind a feature gate and make it a problem for later</p>



<a name="222251103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222251103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222251103">(Jan 11 2021 at 00:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive/near/222249951">said</a>:</p>
<blockquote>
<blockquote>
<p>However, the pointer primitive feels like a bit of a footgun because things like pointer::is_null actually resolve to &lt;*const T&gt;::is_null. </p>
</blockquote>
<p>err, well, they happen to resolve that way for implementation reasons, but they could just as easily have been <code>*mut</code></p>
</blockquote>
<p>Yeah, that's my point: there's no canonical item to link to when you see <code>pointer::is_null</code>.</p>



<a name="222251107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222251107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222251107">(Jan 11 2021 at 00:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive/near/222249962">said</a>:</p>
<blockquote>
<p>I think the practical thing to do is slap this behind a feature gate and make it a problem for later</p>
</blockquote>
<p>Should I open an issue? Also, can you/do you want to do it?</p>



<a name="222252610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222252610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222252610">(Jan 11 2021 at 01:35)</a>:</h4>
<p>I can do it. Feel free to open an issue (I plan to have this done tonight, but in case not it should definitely be done before <a href="https://github.com/rust-lang/rust/pull/80181">https://github.com/rust-lang/rust/pull/80181</a> hits beta).</p>



<a name="222253687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/266220-rustdoc/topic/intra-doc%20%60pointer%60%20primitive/near/222253687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/266220-rustdoc/topic/intra-doc.20.60pointer.60.20primitive.html#222253687">(Jan 11 2021 at 02:03)</a>:</h4>
<p>Issue: <a href="https://github.com/rust-lang/rust/issues/80896">#80896</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>